* Validation of proxy measures for three of the Big 5 personality traits (emotional stability, conscienciousness, extraversion), which are present in the main experiment. Replicates Table A3

clear
set more off

cd ""
use validation_data, replace

gen wave2=1


local i=1
foreach var of varlist section1a_1-section1g_6 {
	rename `var' BFI2_`i'
	local ++i
	}

* The following questions have the wrong orientation and need to be reversed	
numlist "11 16 26 31 36 51 12 17 22 37 42 47 3 8 23 28 48 58 4 9 24 29 44 49 5 25 30 45 50 55"

foreach i in `r(numlist)' {
		*** because the values start at 1, when reversing need to add the number of values (here 5) plus 1
		replace BFI2_`i' =-BFI2_`i'+6

		}
	

* facets
* E	
gen sociability=BFI2_1+BFI2_16+BFI2_31+BFI2_46
gen assertiveness=BFI2_6+BFI2_21+BFI2_36+BFI2_51
gen energy=BFI2_11+BFI2_26+BFI2_41+BFI2_56
* A
gen compassion=BFI2_2+BFI2_17+BFI2_32+BFI2_47
gen respectfulness=BFI2_7+BFI2_22+BFI2_37+BFI2_52
gen trust=BFI2_12+BFI2_27+BFI2_42+BFI2_57
* C
gen organization=BFI2_3+BFI2_18+BFI2_33+BFI2_48
gen productiveness=BFI2_8+BFI2_23+BFI2_38+BFI2_53
gen responsibility=BFI2_13+BFI2_28+BFI2_43+BFI2_58
* N
gen anxiety=BFI2_4+BFI2_19+BFI2_34+BFI2_49
gen depression=BFI2_9+BFI2_24+BFI2_39+BFI2_54
gen em_volatily=BFI2_14+BFI2_29+BFI2_44+BFI2_59
* O
gen curiosity=BFI2_10+BFI2_25+BFI2_40+BFI2_55
gen aesthetic_sense=BFI2_5+BFI2_20+BFI2_35+BFI2_50
gen imagination=BFI2_15+BFI2_30+BFI2_45+BFI2_60

gen extrav=sociability+assertiveness+energy
gen agree=compassion+respectfulness+trust
gen consci=organization+productiveness+responsibility
gen neurot=anxiety+depression+em_volatily
gen open=curiosity+aesthetic_sense+imagination

* emotional stability is the reverse of neuroticism 
gen es=-neurot

global traits extrav consci neurot agree open
global facets sociability assertiveness energy organization productiveness responsibility anxiety depression em_volatily compassion respectfulness trust curiosity aesthetic_sense imagination
global ca_facets sociability assertiveness energy organization productiveness responsibility anxiety depression em_volatily 


/*
Domain Scales
Extraversion: 1, 6, 11R, 16R, 21, 26R, 31R, 36R, 41, 46, 51R, 56
Agreeableness: 2, 7, 12R, 17R, 22R, 27, 32, 37R, 42R, 47R, 52, 57
Conscientiousness: 3R, 8R, 13, 18, 23R, 28R, 33, 38, 43, 48R, 53, 58R
Negative Emotionality: 4R, 9R, 14, 19, 24R, 29R, 34, 39, 44R, 49R, 54, 59
Open-Mindedness: 5R, 10, 15, 20, 25R, 30R, 35, 40, 45R, 50R, 55R, 60

Facet Scales
Sociability: 1, 16R, 31R, 46
Assertiveness: 6, 21, 36R, 51R
Energy Level: 11R, 26R, 41, 56
Compassion: 2, 17R, 32, 47R
Respectfulness: 7, 22R, 37R, 52
Trust: 12R, 27, 42R, 57
Organization: 3R, 18, 33, 48R
Productiveness: 8R, 23R, 38, 53
Responsibility: 13, 28R, 43, 58R
Anxiety: 4R, 19, 34, 49R
Depression: 9R, 24R, 39, 54
Emotional Volatility: 14, 29R, 44R, 59
Intellectual Curiosity: 10, 25R, 40, 55R
Aesthetic Sensitivity: 5R, 20, 35, 50R
Creative Imagination: 15, 30R, 45R, 60
*/



******************** Psychometric questions contained in the original experimental dataset
local i=1
foreach var of varlist section2a_1-section2c_10  section2d_2-section2f_7{
	rename `var' canada`i'
	local ++i
	}

* The following questions have the wrong orientation and need to be reversed	
numlist "2 4 5 6 7 8 11 12 14 20 21"
foreach i in `r(numlist)' {
		*** because the values start at 1, when reversing need to add the number of values (here 5) plus 1
		replace canada`i' =-canada`i'+6

		}
		
* The following questions have the wrong orientation and need to be reversed	
numlist "41 49 46 27 44 48 34 56"

foreach i in `r(numlist)' {
		*** because the values start at 1, when reversing need to add the number of values (here 5) plus 1
		replace canada`i' =-canada`i'+6

		}
	
*** country indicator
rename q3 country 




********************* Extraversion ****************************************************

* main classification
egen can_e2=rowtotal(canada21-canada23 canada25 canada26 canada28 canada30 canada40 canada49 canada50    )

* robustness classification
egen can_e_R1=rowtotal(canada19 canada21-canada23 canada28 canada30 canada40 canada46 canada49 canada50    )




********************* Conscientiousness ****************************************************

* main classification
egen can_c2=rowtotal(canada11 canada12 canada13 canada14-canada17 canada19 canada43  canada44)

* robustness classification
egen can_c_R1=rowtotal(canada11 canada12 canada14-canada17 canada27 canada43 canada44 canada48    )





********************* EMOTIONAL STABILITY ****************************************************

* main classification
egen can_s2=rowtotal(canada1  canada4 canada5 canada6 canada7 canada8  canada10 canada41 canada46 canada47     )

* robustness classification
egen can_s_R1=rowtotal(canada1  canada5 canada7 canada8  canada10 canada34 canada41 canada47 canada55 canada56    )

******************* Corelations between proxy measures and personality traits from standard questionnaire


* Full sample, main classification
corr can_e2 extrav sociability assertiveness energy 
corr can_c2 consci organization productiveness responsibility
corr can_s2 neurot anxiety depression em_volatily		

* Table A3: Canadian sub-sample, main classification: Table A3 
corr can_e2 extrav sociability assertiveness energy if country==2
corr can_c2 consci organization productiveness responsibility if country==2
corr can_s2 neurot anxiety depression em_volatily if country==2		 

* Full sample, robustness classification
corr can_e_R1 extrav sociability assertiveness energy 
corr can_c_R1 consci organization productiveness responsibility
corr can_s_R1 neurot anxiety depression em_volatily		

* Canadian sub-sample, robustness classification
corr can_e_R1 extrav sociability assertiveness energy if country==2
corr can_c_R1 consci organization productiveness responsibility if country==2
corr can_s_R1 neurot anxiety depression em_volatily if country==2		

